package cn.icatw.gulimall.order.feign;

import cn.icatw.common.utils.R;
import cn.icatw.gulimall.order.vo.WareSkuLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * wms假装服务
 *
 * @author icatw
 * @date 2022/3/26
 * @email 762188827@qq.com
 * @apiNote
 */
@FeignClient("gulimall-ware")
public interface WmsFeignService {

    /**
     * 查询sku是否有库存
     *
     * @param skuIds sku id
     * @return {@link R}
     */
    @PostMapping("ware/waresku/hasstock")
    R getSkuHasStock(@RequestBody List<Long> skuIds);

    /**
     * 获取商品运费
     *
     * @param addrId 地址id
     * @return {@link R}
     */
    @GetMapping("ware/wareinfo/fare")
    R getFare(@RequestParam("addrId") Long addrId);

    /**
     * 为某个订单锁定库存
     *
     * @param vo 签证官
     * @return {@link R}
     */
    @PostMapping("ware/waresku/lock/order")
    R orderLockStock(@RequestBody WareSkuLockVo vo);
}
